package ext.sim.contact;

import ext.sim.Body;
import math.vec3;
import static math.vec3.*;

public class Contact
{
    
    
    public Body mA;
    public Body mB;
    
    public int mI;
    public int mJ;
    
    public vec3 mPoint;
    
    public vec3 mNormal;
    public vec3 mTangent;
    public vec3 mBitangent;
    
    public vec3 mRi;
    public vec3 mRj;
    
    
    public Contact(
            Body A, Body B, 
            int I, int J, 
            vec3 point, 
            vec3 normal)
    {
        this.mA = A;
        this.mB = B;
        
        this.mI = I;
        this.mJ = J;
        
        this.mPoint = point;
        
        this.mNormal = normal;
        this.mTangent = norm(perp(normal));
        this.mBitangent = norm(cross(normal, this.mTangent));
        
        this.mRi = sub(point, A.mX);
        this.mRj = sub(point, B.mX);
    }
    
    
}
